import './VMessage.css'

// eslint-disable-next-line no-unused-vars
export default function(h) {
  const template = (() => {
    let showCloseText
    if (this.showClose) showCloseText = <i class='el-icon-close float-right' onClick={this.close}></i>
    if (this.count) {
      return (
        <transition name='v-message'>
          <div class='v-message'>
            <div class={`v-message-main v-message-main-${this.type} ${this.borderStyle}`}>
              {/* 图标 */}
              <i class={`el-icon-${this.type}`}></i>
              {/* 提示内容 */}
              <div class='v-message-content'>{this.content}</div>
              {showCloseText}
            </div>
          </div>
        </transition>
      )
    } else {
      return null
    }
  })()
  return (
    template
  )
}
